package com.xx.ems.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * @author xxx
 * @date 2014-2-25
 * @version 1.0
 * 描述: 设备名表
 */
@Entity
public class Ename {
	/**
	 * 描述：主键
	 */
	private Integer nid;
	/**
	 * 描述：设备名称
	 */
	private String nname;
	/**
	 * 描述：设备类别表关联对象
	 */
	private Ecategory ecategory;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="nid",unique=true,nullable=false)
	public Integer getNid() {
		return nid;
	}
	public void setNid(Integer nid) {
		this.nid = nid;
	}
	@Column(name="nname",length=30,nullable=false)
	public String getNname() {
		return nname;
	}
	public void setNname(String nname) {
		this.nname = nname;
	}
	@ManyToOne(targetEntity=Ecategory.class)
	@JoinColumn(name="fk_cid")
	public Ecategory getEcategory() {
		return ecategory;
	}
	public void setEcategory(Ecategory ecategory) {
		this.ecategory = ecategory;
	}
}
